#include "r5.h"
#include "dos.h"

//constants for com_open
#define NO_ERROR                                0
#define INVALID_EVEN_FLAG                    -101
#define INVALID_BAUD_RATE                    -102
#define PORT_OPEN                            -103

//constants for com_close
#define SERIAL_PORT_NOT_OPEN                 -201

//constants for com_read and com_write
#define PORT_NOT_OPEN                        -301
#define VALID_BUFFER_ADDRESS                 -302
#define INVALID_COUNT_ADDRESS_OR_COUNT_VALUE -303
#define DEVICE_BUSY                          -304

int com_open(int *ef_p, int baud_rate)
{
	//this initializes the port
	//sets the interrupt vector to the new handler address
	//computer and baud rate divisor
	//set other characteriseics
	//interrupts
	return 0;
}

int com_close(void)
{
	//check to see if port is open
	//close DCB
	//disable approproate level of PIC
	//load 0x00 nto modem status and interrupt Enable registers
	//restore orignal interrupt handler
	return 0;
}

int com_read(char *buf_p, int *count_p)
{
	return 0;
}

int com_write(char *buf_p, int *count_p)
{
	return 0;
}

void interrupt interrupt_top()
{
	
}